<!DOCTYPE html>
<html>

<head>
    <title>{$category.name} {$category.seo_title} {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$category.seo_keywords},{$site_info.site_seo_keywords|default=''}" />
    <meta name="description" content="{$category.seo_description},{$site_info.site_seo_description|default=''}">
    <include file="public@head" />
    <hook name="before_head_end" />
</head>

<body class="body-black">
    <include file="public@nav" />
    <notempty name="theme_vars.rental_top_banner">
        <div class="top-banner"><img src="/upload/{$theme_vars.rental_top_banner}"></div>
        <else/>
        <div class="text-center"><b>请在后台设置模版顶部banner图</b></div>
    </notempty>
    <div class="container">
        <div class="row text-center">
            <div style="margin-bottom: 40px;">
                <h1 class="title">新闻</h1>
                <h3 class="sub_title">NEWS</h3>
            </div>
            <div class="info-tab text-center">
                <span class="action">最新资讯</span>
            </div>
            <div class="clearboth"></div>
        </div>

        <div class="row">
            <div class="news-box" style="margin: 35px -15px;">
                <php>
                    $where=[ 'post.create_time'=>['egt',0] ];
                </php>
                <portal:articles item="vo" where="$where" order="post.create_time DESC" limit="3" relation="categories" categoryIds="$category.id" returnVarName="articles_data">
                    <div class="col-md-4 car-box">
                        <div class="tc-gridbox news-tc-gridbox">
                            <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">
                                <div class="header">
                                    <div class="item-image">
                                        <present name="vo.more.thumbnail">
                                            <empty name="vo.more.thumbnail">
                                                <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                                <else/>
                                                <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive" alt="">
                                            </empty>
                                            <else/>
                                            <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                        </present>
                                    </div>
                                    <h3 class="title news-box-title">
                                        {$vo.post_title}
                                    </h3>

                                </div>
                            </a>
                        </div>
                    </div>
                </portal:articles>
                <div class="clearboth"></div>
            </div>
        </div>
        <div class="row list-head">
            <div class="news-head-title">{$site_info.site_name|default='壹车汇'}动态</div>
            <div class="clearboth"></div>
        </div>
        <div class="row">
            <div class="news-box">
                <php>
                    $where=[ 'post.create_time'=>['egt',0] ];
                </php>
                <portal:articles item="vo" where="$where" order="post.create_time DESC" page="5" relation="categories" categoryIds="$category.id" returnVarName="articles_data">
                    <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">
                        <div class="list-boxes">

                            <div class="pull-left">
                                <div class="news-date">
                                    <div class="day">{$vo.update_time|date="d",###}</div>
                                    <div class="date">{$vo.update_time|date="Y.m",###}</div>
                                </div>
                            </div>
                            <div class="pull-left news-box-content">
                                <div class="list-actions">
                                    <h2>{$vo.post_title}</h2>
                                    <p>{$vo.post_excerpt}</p>
                                </div>
                            </div>
                            <div class="pull-right news-list-img">
                                <present name="vo.more.thumbnail">
                                    <empty name="vo.more.thumbnail">
                                        <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                        <else/>
                                        <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive" alt="">
                                    </empty>
                                    <else/>
                                    <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                </present>
                            </div>
                        </div>
                    </a>
                </portal:articles>

            </div>
            <div class="text-center">
                <ul class="pagination">
                    <page/>
                </ul>
            </div>
        </div>
        <div class="hot-footer">
            <div class="row list-head">
                <div class="news-head-title hot-title">热门推荐</div>
                <div class="refresh hot-footer-refresh">换一批</div>
                <div class="clearboth"></div>
            </div>
            <div class="row" style="margin:0 -30px" id="refresh-box">
                <rental:cars limit="4" order="RAND()">
                    <div class="col-md-3 car-box">
                        <div class="tc-gridbox">
                            <a href="{:cmf_url( 'rental/Car/index',array( 'id'=>$vo.id,'cid'=>$vo.category_id))}">
                                <div class="header">
                                    <div class="item-image">
                                        <present name="vo.more.thumbnail">
                                            <empty name="vo.more.thumbnail">
                                                <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                                <else/>
                                                <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive" alt="">
                                            </empty>
                                            <else/>
                                            <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                        </present>
                                    </div>
                                    <h3 class="title">
                                        {$vo.title}
                                    </h3>
                                    <div class="title price">
                                        <span class="now-price">一口价：{$vo.primary.price}万</span>&nbsp;&nbsp;&nbsp;<span class="m-price">市场价：{$vo.primary.m_price}万</span>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
                </rental:cars>
            </div>
            <script type="text/javascript">
                $(function() {
                    var refresh_url = '{:url("rental/Car/refreshAjax")}';
                    $('.hot-footer-refresh').click(function() {
                        $.get(refresh_url, function(result) {
                            // $("#refresh-box").html('');
                            $("#refresh-box").html(result);
                        });
                    });

                });
            </script>
        </div>
    </div>
    <include file="public@footer" />
    <include file="public@scripts" />
    <hook name="before_body_end" />
</body>

</html>